<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base href="<%=basePath%>">

    <title>My JSP 'show.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

    <div th:replace="~{commons/script::script}"></div>
</head>
<style>
    * {
        margin-left: 10px;
        padding: 3px;
    }

    .tip {

        height: 30px;
        text-align: right;
        background-color: #F5F5F5;
    }
</style>
<body>
<form id="newCustomer" method="post">
    <table>
        <tr>
            <td class="tip">姓名：</td>
            <td><input type="hidden" name="id" th:value="${contacts.id}"/>
                <input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="name" th:value="${contacts.name}"></td>
            <td class="tip">性别：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="sex" th:value="${contacts.sex}"></td>
        </tr>
        <tr>
            <td class="tip">部门：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="department" th:value="${contacts.department}"></td>
            <td class="tip">职位：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="post" th:value="${contacts.post}"></td>
        </tr>
        <tr>
            <td class="tip">称呼：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="saltname" th:value="${contacts.saltname}"></td>
            <td class="tip">电话：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="telephone" th:value="${contacts.telephone}"></td>
        </tr>
        <tr>
            <td class="tip">QQ：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="qqno" th:value="${contacts.qqno}"></td>
            <td class="tip">Email：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="email" th:value="${contacts.email}"></td>
        </tr>
        <tr>
            <td class="tip">地址：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="address" th:value="${contacts.address}"></td>
            <td class="tip">邮编：</td>
            <td><input class="easyui-textbox validatebox-text validatebox-readonly"
                       name="zipcode" th:value="${contacts.zipcode}"></td>
        </tr>

        <tr>
            <td class="tip">描述：</td>
            <td colspan="3">
            <textarea style="width:579px;height:60px;" class="easyui-textbox"
                      name="description" th:text="${contacts.description}"></textarea>
            </td>
        </tr>
        <tr>
            <td colspan="4">系统信息</td>
        </tr>
        <tr>
            <td colspan="4" style="text-align: center;">
                <a id="del" href="javascript:void(0);" class="easyui-linkbutton button-purple">修改</a>
            </td>
        </tr>
    </table>
</form>
</body>
<script type="text/javascript">
    $(function(){
        $("#del").on("click",function(e){
            $.post("/contacts/change",
                $("#newCustomer").serialize(),
                function(data){
                    $.messager.alert({
                        title:"提示",
                        msg:data.msg,
                    })
                },"json")
        })
    })
</script>
</html>
